#include <iostream>
#include <cstring>

using namespace std;

class Solution {
public:
    int f[35];
    int dfs(int n)
    {
        if (f[n] != -1) return f[n];
        if (n == 0 || n == 1) return n;

        f[n] = dfs(n - 1) + dfs(n - 2);
        return f[n];
    }
    int fib(int n) {
        memset(f, -1, sizeof f);
        return dfs(n);
    }
};

int main()
{
    Solution s1;
    cout << s1.fib(3) << endl;
    return 0;
}